package com.beidouapp.service.impl;

import com.beidouapp.common.contant.SecurityContant;
import com.beidouapp.common.enums.YesNoEnum;
import com.beidouapp.dao.OrganizationAndRoleDao;
import com.beidouapp.dao.OrganizationDao;
import com.beidouapp.domain.pojo.Organization;
import com.beidouapp.domain.pojo.OrganizationAndRole;
import com.beidouapp.exception.BusinessException;
import com.beidouapp.service.OrganizationAndRoleService;
import com.beidouapp.service.OrganizationService;
import com.beidouapp.translator.TranslatorManager;
import com.beidouapp.utils.UIUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrganizationAndRoleServiceImpl implements OrganizationAndRoleService {


    @Autowired
    private OrganizationAndRoleDao organizationAndRoleDao;

    @Override
    public int removeEntry(OrganizationAndRole organizationAndRole){
       return organizationAndRoleDao.removeEntry(organizationAndRole);
    }

    @Override
    public int addOrganizationAndRoleBatch(Long orgId, List<Long> roleIdList) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("orgId", orgId);
        params.put("list", roleIdList);
        return organizationAndRoleDao.addOrganizationAndRoleBatch(params);
    }
}
